<!DOCTYPE html>
<html lang="en" >
<head>
    <meta charset="UTF-8">
    <title>EventBind</title>
</head>
<body>
<div id="app">
    <!--  点击按钮，num数据+1  -->
    {{num}}
    <button v-on:click="num++">自增</button>
    <!--简化写法-->
    <button @click="num++">自增</button>
    <!--  可以绑定一个方法  -->
    <button @click="addNum">自增</button>
</div>
<script src="../js/vue.js" ></script>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            num: 100
        },
        methods: {
            addNum(){
                this.num++
            }
        }
    })
</script>
</body>

</html>